<html>
<head>
    <meta http-equiv="content-type" content="text/html;charset=utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <link href="http://www.sgfoot.com/favicon.png" rel="shortcut icon"/>
    <title>日记查看系统</title>
    <link rel="stylesheet" href="/pear/css/pear.css" />
    <script src="/component/layui/layui.js?v=2.8.12"></script>
    <script src="/component/pear/pear.js"></script>
    <style>
        *{
            margin: 0;
            padding:0;
        }
        .row{
            margin: 10px auto;
            width:80%;
        }
        .col{
            width:30%;
            height:25px;

            float: left;

            margin-right: 23px;
        }
        a{
            color: #333;
        }
    </style>
</head>
<body>
<h1 align="center" style="margin-bottom: 10px;">日记查看系统</h1>
<h3 align="center" style="margin-bottom: 20px;">
    <a href="/test/viewlog/index" class="go_home">回到首页</a> ||
    <a href="javascript:history.go(-1);">返回上一页</a>
</h3>
<div align="center" class="html_content">
    <div class="row">
        <dl  class="col">名称</dl>
        <dl  class="col">最后修改时间</dl>
        <dl  class="col">大小</dl>
    </div>

</div>
<div class="footer"></div>
<script>
    let domain;
    const params = new URLSearchParams(window.location.search);
    const dirpath = params.get('dirpath');
    layui.use(["element", "popup"], function() {
        let loading = layer.load();
        layui.$.ajax({
            url: "/test/viewlog/getview?dirpath="+dirpath,
            type: "POST",
            dataType: "json",
            data: {},
            success: function (res) {
                if (res.code) {
                    return layui.popup.failure(res.msg);
                }
                const data = res.result.data;
                domain = res.result.domain;
                let html = '';
                layui.$.each(data,function (i,v) {
                    if(v.isfile==1){
                        html += '<div class="col"><a href="/test/viewlog/getview?dirpath='+v.url+'" target="_blank">'+v.name+'</a></div>';
                    }else{
                        html += '<div  class="col"><a href="/test/viewlog/getview?dirpath='+v.url+'">'+v.name+'</a></div>';
                    }
                   html += '<div  class="col">'+v.time+'</div>\n' +
                       '        <div  class="col">'+v.size+'</div>';
                })
                layui.$('.html_content').append(html);
                layer.close(loading);
            },
            complete: function () {
                layer.close(loading);
            }
        })
    })

</script>
</body>
</html>

